<link rel="stylesheet" href="assets/css/bootstrap-select.min.css" />
<!-- 右侧  -->
<div id="page-inner">
    <div class="panel-body">
        <div class="row">
            <div class="col-md-12">
                <h1 class="page-header">
                    水平衡测试 <small>企业用水分析表</small>
                </h1>
            </div>
        </div>
        <div class="row"></div>
        	<!-- add time select -->
        	<div class="right col-xs-6 text-left">
        		<!-- add show time and unit -->
        		<div class="right col-xs-6 text-left">
        			<div class="form-group">
<!--        				<span class="glyphicon glyphicon-time"></span>-->
<!--        				<label style="font-size:20px;font-weight:normal">测评日期：</label>-->
<!--        				<label id="nowdate" style="font-size:20px;font-weight:normal"></label>-->
            		</div>
            		<div class="form-group">
            			<span class="glyphicon glyphicon-inbox"></span>
        				<label style="font-size:20px;font-weight:normal">单位：</label>
        				<label style="font-size:20px;font-weight:normal">m³/h</label>
            		</div>
        		</div>
        	</div>
        	<div id="toolbar" class="btn-group">
            	<button id="btn_add" type="button" class="btn btn-default">
                	<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
            	</button>
            	<button id="btn_edit" type="button" class="btn btn-default">
                	<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>编辑
            	</button>
            	<button id="btn_delete" type="button" class="btn btn-default">
                	<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
            	</button>
            	<button id="btn_return" type="button" class="btn btn-default">
                	<span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>返回
            	</button>
        	</div>
    	</div>
        <table id="data_table" class="table-striped table-hover"></table>
    </div>
</div>


<!-- 添加 -->
<div class="modal fade" id="new_data" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">添加一项企业用水分析评估信息</h4>
            </div>
            <div class="modal-body" id="new_data_body">
            	<div class="form-group">
                    <label>用水区域</label>
                    <select name="location" class="form-control" id="newLocation" onchange="newModelEventChange()">
                        <option value="生产用水">生产用水</option>
                        <option value="非生产用水">非生产用水</option>
                    </select>
                </div>
            	<div class="form-group">
                    <label>用水类别</label>
                    <select name="waterClass" class="form-control" id="newWaterClass">
                    	<option value="主要生产用水">主要生产用水</option>
                        <option value="辅助生产用水">辅助生产用水</option>
                        <option value="附属生产用水">附属生产用水</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>用水用途</label>
                    <input class="form-control" placeholder="必填" id="newWaterUsing" name="new" >
                </div>
                <hr style="height:1px;border:none;border-top:1px solid #555555;" />
                <div class="form-group">
                    <label>用水量</label>
                    <input class="form-control" placeholder="必填" id="newUseWater" name="new" value=0>
                </div>
                <div class="form-group">
                    <label>用水量占总用水量的比例</label>
                    <input class="form-control" placeholder="必填且输入数字在0-1之间" id="newUseProportion" name="new" value=0>
                </div>
                <div class="form-group">
                    <label>新水量</label>
                    <input class="form-control" placeholder="必填" id="newNewWater" name="new" value=0>
                </div>
                <div class="form-group">
                    <label>新水量占总新水量的比例</label>
                    <input class="form-control" placeholder="必填且输入数字在0-1之间" id="newNewProportion" name="new" value=0>
                </div>
                <div class="form-group" id="newRepeatWaterDiv">
                    <label>重复利用水量</label>
                    <input class="form-control" placeholder="必填" id="newRepeatWater" name="new" value=0>
                </div>
                <div class="form-group" id="newDrainWaterDiv">
                    <label>排水量</label>
                    <input class="form-control" placeholder="必填" id="newDrainWater" name="new" value=0>
                </div>
                <div class="form-group" id="newConsumpWaterDiv">
                    <label>耗水量</label>
                    <input class="form-control" placeholder="必填" id="newConsumpWater" name="new" value=0>
                </div>
                <div class="form-group" id="newLossWaterDiv">
                    <label>漏失水量</label>
                    <input class="form-control" placeholder="必填" id="newLossWater" name="new" value=0>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="new_data_submit">提交</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 编辑 -->
<div class="modal fade" id="edit_data" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">编辑一项企业用水分析评估信息</h4>
            </div>
            <div class="modal-body">
            	<div class="form-group">
                    <label>用水区域</label>
                    <input class="form-control" id="editLocation" name="edit" readonly="readonly">
                </div>
            	<div class="form-group">
                    <label>用水类别</label>
                    <input class="form-control" id="editWaterClass" name="edit" readonly="readonly">
                </div>
                <div class="form-group">
                    <label>用水细节</label>
                    <input class="form-control" placeholder="必填" id="editWaterUsing" name="edit">
                </div>
                <div class="form-group">
                    <label>用水量</label>
                    <input class="form-control" placeholder="必填" id="editUseWater" name="edit" value=0>
                </div>
                <div class="form-group">
                    <label>用水量占总用水量的比例</label>
                    <input class="form-control" placeholder="必填且输入数字在0-1之间" id="editUseProportion" name="edit" value=0>
                </div>
                <div class="form-group">
                    <label>新水量</label>
                    <input class="form-control" placeholder="必填" id="editNewWater" name="edit" value=0>
                </div>
                <div class="form-group">
                    <label>新水量占总新水量的比例</label>
                    <input class="form-control" placeholder="必填且输入数字在0-1之间" id="editNewProportion" name="edit" value=0>
                </div>
                <div class="form-group" id="editRepeatWaterDiv" >
                    <label>重复利用水量</label>
                    <input class="form-control" placeholder="必填" id="editRepeatWater" name="edit" value=0>
                </div>
                <div class="form-group" id="editDrainWaterDiv" >
                    <label>排水量</label>
                    <input class="form-control" placeholder="必填" id="editDrainWater" name="edit" value=0>
                </div>
                <div class="form-group" id="editConsumpWaterDiv" >
                    <label>耗水量</label>
                    <input class="form-control" placeholder="必填" id="editConsumpWater" name="edit" value=0>
                </div>
                <div class="form-group" id="editLossWaterDiv">
                    <label>漏失水量</label>
                    <input class="form-control" placeholder="必填" id="editLossWater" name="edit" value=0>
                </div>
                <div class="form-group" id="editCalSum">
                	<legend>生产用水汇总统计</legend>
                	<div id="editCalFor1" ><fieldset class="form-group" >
    					<legend>1.单位产品取水量计算</legend>
    					<div class="form-group">
                    		<label>取水量</label>
                    		<input class="form-control" id="editCalParam11" name="edit" value=0 readonly="readonly">
                		</div>
                		<div class="form-group">
                    		<label>产品产量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam12" name="edit" value=0 >
                		</div>
						<div class="form-group">
                    		<label>备注：单位产品取水量=取水量÷产品产量</label>
                    		<label>取水量为'企业水平衡测试统计表'的'常规水资源量汇总量'</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor2" ><fieldset class="form-group" >
    					<legend>2.直接冷却水循环率计算</legend>
    					<div class="form-group">
                    		<label>直接冷却水循环量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam21" name="edit" value=0>
                		</div>
                		<div class="form-group">
                    		<label>直接冷却水循环系统补充水量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam22" name="edit" value=0>
                		</div>
						<div class="form-group">
                    		<label>备注：直接冷却水循环率=直接冷却水循环量÷(直接冷却水循环系统补充水量+直接冷却水循环量)×100%</label>
                    		<label>直接冷却水循环系统补充水量，直接冷却水循环量单位为立方米每小时</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor3" ><fieldset class="form-group" >
    					<legend>3.蒸汽冷凝水回用率计算</legend>
    					<div class="form-group">
                    		<label>蒸汽冷凝水回用量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam31" name="edit" value=0>
                		</div>
                		<div class="form-group">
                    		<label>产汽设备产汽量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam32" name="edit" value=0>
                		</div>
						<div class="form-group">
                    		<label>备注：蒸汽冷凝水回用率=蒸汽冷凝水回用量÷产汽设备产汽量×蒸汽体积质量×100%</label>
                    		<label>蒸汽体积质量是常量，取值1吨每立方米</label>
                    		<label>蒸汽冷凝水回用量单位为立方米每小时,产汽设备产汽量单位为吨每小时</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor4" ><fieldset class="form-group" >
    					<legend>4.漏失率计算</legend>
    					<div class="form-group">
                    		<label>漏失水量</label>
                    		<input class="form-control" id="editCalParam41" name="edit" value=0 readonly="readonly">
                		</div>
                		<div class="form-group">
                    		<label>新水量</label>
                    		<input class="form-control" id="editCalParam42" name="edit" value=0 readonly="readonly">
                		</div>
						<div class="form-group">
                    		<label>备注：漏失率=漏失水量÷新水量×100%</label>
                    		<label>漏失水量,新水量都是表中的汇总数据</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor5" ><fieldset class="form-group">
    					<legend>5.废水达标排放率计算</legend>
    					<div class="form-group">
                    		<label>企业达到排放标准排水量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam51" name="edit" value=0>
                		</div>
                		<div class="form-group">
                    		<label>企业排水量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam52" name="edit" value=0>
                		</div>
						<div class="form-group">
                    		<label>备注：废水达标排放率=企业达到排放标准排水量÷企业排水量×100%</label>
                    		<label>企业达到排放标准排水量，企业排水量单位为立方米</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor6" ><fieldset class="form-group">
    					<legend>6.重复利用率计算</legend>
    					<div class="form-group">
                    		<label>重复利用水量</label>
                    		<input class="form-control" id="editCalParam61" name="edit" value=0 readonly="readonly">
                		</div>
                		<div class="form-group">
                    		<label>新水量</label>
                    		<input class="form-control" id="editCalParam62" name="edit" value=0 readonly="readonly">
                		</div>
						<div class="form-group">
                    		<label>备注：重复利用率=重复利用水量÷(重复利用水量+新水量)</label>
                    		<label>重复利用水量,新水量为表中已有汇总数据</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor7"><fieldset class="form-group">
    					<legend>7.间接冷却水循环率计算</legend>
    					<div class="form-group">
                    		<label>间接冷却水循环量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam71" name="edit" value=0>
                		</div>
                		<div class="form-group">
                    		<label>间接冷却水循环系统补充水量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam72" name="edit" value=0>
                		</div>
						<div class="form-group">
                    		<label>备注：间接冷却水循环率=间接冷却水循环量÷(间接冷却水循环量+间接冷却水循环系统补充水量)×100%</label>
                    		<label>间接冷却水循环量,间接冷却水循环系统补充水量单位都为立方米每小时</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor8"><fieldset class="form-group" >
    					<legend>8.排水率计算</legend>
    					<div class="form-group">
                    		<label>企业外排水量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam81" name="edit" value=0>
                		</div>
                		<div class="form-group">
                    		<label>新水量</label>
                    		<input class="form-control" id="editCalParam82" name="edit" value=0 readonly="readonly">
                		</div>
						<div class="form-group">
                    		<label>备注：排水率=企业外排水量÷新水量</label>
                    		<label>企业外排水量,新水量单位都为立方米,新水量为表中汇总数据</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor9"><fieldset class="form-group" >
    					<legend>9.废水回用率计算</legend>
    					<div class="form-group">
                    		<label>废水回用量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam91" name="edit" value=0>
                		</div>
                		<div class="form-group">
                    		<label>废水外排水量</label>
                    		<input class="form-control" placeholder="必填且输入必须大于等于0" id="editCalParam92" name="edit" value=0>
                		</div>
						<div class="form-group">
                    		<label>备注：废水回用率=废水回用量÷(废水回用量+废水外排水量)×100%</label>
                    		<label>废水回用量,废水外排水量单位都为立方米</label>
                    	</div>
  					</fieldset></div>
  					<hr style="height:1px;border:none;border-top:1px solid #c0c0c0;" />
  					<div id="editCalFor0"><fieldset class="form-group" >
    					<legend>10.非常规水资源替代率计算</legend>
    					<div class="form-group">
                    		<label>非常规水资源利用量</label>
                    		<input class="form-control" id="editCalParam01" name="edit" value=0 readonly="readonly">
                		</div>
                		<div class="form-group">
                    		<label>常规水资源量</label>
                    		<input class="form-control" id="editCalParam02" name="edit" value=0 readonly="readonly">
                		</div>
						<div class="form-group">
                    		<label>备注：非常规水资源替代率=非常规水资源利用量÷(非常规水资源利用量+常规水资源量)×100%</label>
                    		<label>非常规水资源利用量,常规水资源量单位都为立方米,为'企业水平衡测试统计表'的'常规水资源量汇总量'</label>
                    	</div>
  					</fieldset></div>
                </div>
            </div>
            <div class="modal-footer">
            	<button type="button" class="btn btn-info" id="edit_data_suminfo">汇总编辑</button>
                <button type="button" class="btn btn-primary" id="edit_data_submit">提交</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 汇总编辑 -->
<div class="modal fade" id="count_data" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">编辑一项企业用水分析评估信息</h4>
            </div>
            <div class="modal-body">
                <div class="form-group" id="editCalSum">
                	<div id="editCalFor1" ><fieldset class="form-group" >
                	    <legend id="sum_title"></legend>
                	    <div class="form-group">
                    		<label id="sum_param1"></label>
                		</div>
                		<div id="input_style1">
                	               <label>输入方式</label>
                                   <select  id="newSelect_id1" class="form-control selectpicker" title="请选择输入方式" 
                                   onchange="change($('#newSelect_id1 option:selected').val(),1)">
                                       <option value="1">手工录入</option>
                                       <option value="0">自动录入</option>
					               </select>
                	         </div>
                	    <div class="form-group" id="sum_param1_num">
                	         
					    </div>
					    <div id = "param1">
    					<div class="form-inline" id="sum_numbers1" style="display: none;">
                    		<label>输入次数</label>
                    		<input class="form-control" id="sum_input_num1">
                    		<button type="button" class="btn btn-primary" id="sum_numbers_submit1" onclick="sum_numbers_table(1)">点击生成</button>
                		</div>
                		
    					<div class="form-group" id="sum_param1_group">
    				     	<label></label>
                    		<table id="sum_param1_table" class="table-striped table-hover table table-bordered"></table>
                    		
                		</div>
                		<div class="form-group" id="sum_sensor_select1" style="display: none;">
                	    	<label>设备选择</label> 
                	    	<div class="panel-body">
					    		<div >
									<label >车间名称</label>
									 <div class="input-group col-md-9">					 		
										<select id="work_id1" class="form-control selectpicker"
											data-live-search="true" title="请选择车间名称" multiple
											data-actions-box="true" data-selected-text-format="count > 5">
										</select>				 
									</div>
								</div>
								<div>
									<label>设备类型</label>
									<div class="input-group col-md-9">
										<select id="select_type1" class="form-control selectpicker"
											title="请选择设备类型">
										</select>
									</div>
								</div>
								<div>
									<label>设备编号</label>
									<div class="input-group col-md-9">
										<select id="select_no1" class="form-control selectpicker"
											title="请选择设备编号">
										</select>
									</div>
								</div>
							</div>
                		</div>
                		<div class="form-group" id="sum_param1_result_group" style="display: none;">
    				     	<label></label>
                    		<table id="sum_param1_result_table" class="table-striped table-hover table table-bordered"></table>
                    		
                		</div>
                		<div class="form-inline" id="sum_average1_div" style="display: none;">
                    		<label>差值平均值</label>
                    		<input class="form-control" id="sum_average1">
                		</div>
                		
                		</div>
                		
                		<div class="form-group" id="sum_param_group">
                    		<label id="sum_param2"></label>
                		</div>
                		<div id="input_style2">
                		           <label>输入方式</label>
                                   <select  id="newSelect_id2" class="form-control selectpicker" title="请选择输入方式" 
                                   onchange="change($('#newSelect_id2 option:selected').val(),2)">
                                        <option value="1">手工录入</option>
                                        <option value="0">自动录入</option>
					               </select>
                		     </div>
                		<div class="form-group" id="sum_param2_num">
                		     
					    </div>
					    <div id = "param2">
    					<div class="form-inline" id="sum_numbers2" style="display: none;">
                    		<label>输入次数</label>
                    		<input class="form-control" id="sum_input_num2">
                    		<button type="button" class="btn btn-primary" id="sum_numbers_submit2" onclick="sum_numbers_table(2)"">点击生成</button>
                		</div>
                		
    					<div class="form-group" id="sum_param2_group">
    				     	<label></label>
                    		<table id="sum_param2_table" class="table-striped table-hover table table-bordered"></table>
                    		
                		</div>
                		<div class="form-group" id="sum_sensor_select2" style="display: none;">
                	    	<label>设备选择</label> 
                	    	<div class="panel-body">
					    		<div >
									<label >车间名称</label>
									 <div class="input-group col-md-9">					 		
										<select id="work_id2" class="form-control selectpicker"
											data-live-search="true" title="请选择车间名称" multiple
											data-actions-box="true" data-selected-text-format="count > 5">
										</select>				 
									</div>
								</div>
								<div>
									<label>设备类型</label>
									<div class="input-group col-md-9">
										<select id="select_type2" class="form-control selectpicker"
											title="请选择设备类型">
										</select>
									</div>
								</div>
								<div>
									<label>设备编号</label>
									<div class="input-group col-md-9">
										<select id="select_no2" class="form-control selectpicker"
											title="请选择设备编号">
										</select>
									</div>
								</div>
							</div>
                		</div>
                		<div class="form-group" id="sum_param2_result_group" style="display: none;">
    				     	<label></label>
                    		<table id="sum_param2_result_table" class="table-striped table-hover table table-bordered"></table>
                    		
                		</div>
                		<div class="form-inline" id="sum_average2_div" style="display: none;">
                    		<label>差值平均值</label>
                    		<input class="form-control" id="sum_average2">
                		</div>
                		
                		</div>
                		<div id="result" style="display: none; margin-top: 45px">
                    		<label>计算结果</label>
                    		<input class="form-control" id="result_input" readOnly="readOnly">
                		</div>
						<div class="form-group">
                    		<label id="sum_bark"></label>
                    	</div>
  					</fieldset></div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="count_data_submit">提交</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>


<script src="pages/js/entity_eva_cmp_water_anl_sum.js"></script>
<script src="pages/js/entity_eva_cmp_water_anl.js"></script>
<script src="pages/js/field_check.js"></script>
